import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import Layout from '../Layout.vue'

const router = createRouter({
  // history: createWebHistory(import.meta.env.BASE_URL),
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: Layout,
      alias: '/layout',
      children: [
        {
          path: 'user_list',
          name: 'user_list',
          component: () => import('../views/user/ListView.vue')
        },
        {
          path: 'banner_add',
          name: 'banner_add',
          component: () => import('../views/banner/AddView.vue')
        },
        {
          path: 'banner_list',
          name: 'banner_list',
          component: () => import('../views/banner/ListView.vue')
        },
        {
          path: 'navi_add',
          name: 'navi_add',
          component: () => import('../views/navi/AddView.vue')
        },
        {
          path: 'navi_list',
          name: 'navi_list',
          component: () => import('../views/navi/ListView.vue')
        },
        {
          path: 'classify',
          name: 'classify',
          component: () => import('../views/pet/classify.vue')
        },
        {
          path: 'publish',
          name: 'publish',
          component: () => import('../views/pet/publish.vue')
        },
        {
          path: '/setting',
          name: 'setting',
          component: () => import('../views/SetView.vue')
        },
      ]
    },
    {
      path: '/login',
      name: 'login',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/LoginView.vue'),
    },
  ],
})

export default router
